import { defineStore } from 'pinia'
export const useSideStore = defineStore({
  // id: 必须的，在所有 Store 中唯一
  id: "side",
  // a function that returns a fresh state
  state: () => {
    return {
      token: '',
      isLoginShow: false,
      isMobile: false,
      masValue: 0,
      querytotal: null,
      userInfo: {
        organization: null
      }
    }
  },
  // optional actions
  actions: {
    SETQUERYTOTAL (e) {
      this.querytotal = e
    },
    SETUSERINFO (e) {
      this.userInfo = e
    },
    SETMASVALUE (e=0) {
      this.masValue = e
    },
    SETISMOBILE (e) {
      this.isMobile = e
    },
    SETTOKEN (e) {
      this.token = e
    },
    SETLOGINSHOW (e) {
      this.isLoginShow = e
    }
  },
})